import java.math.BigDecimal;

public class Main {
    public static void main(String[] args) {
        GoldCard goldCard = new GoldCard();
        goldCard.setPrice(BigDecimal.valueOf(10000));
        goldCard.setCardType(CardType.GOLD_CARD);
        goldCard.pay(BigDecimal.valueOf(800));
    }

    private static void processUserInput(String input) {
        if (input == null || input.trim().isEmpty()) {
            throw new IllegalArgumentException("Input cannot be empty");
        }
        
        String[] parts = input.split(",");
        if (parts.length != 3) {
            throw new IllegalArgumentException("Input format: cardType,amount,months");
        }
        
        CardType type = CardType.valueOf(parts[0].toUpperCase());
        BigDecimal amount = new BigDecimal(parts[1]);
        int months = Integer.parseInt(parts[2]);
        
        processCardRegistration(type, amount, months);
    }

    private static void processCardRegistration(CardType type, BigDecimal amount, int months) {
        // ...原有注册逻辑...
    }
}
